package com.nbsaas.boot.merchant.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商家评价", model = "商家评价")
@Entity
@Table(name = "bs_merchant_review")
@Comment("商家评价表")
public class MerchantReview extends AbstractEntity {

    @Comment("商家ID")
    @FormField(title = "商家", sortNum = "1", type = InputType.select, required = true)
    private Long merchantId;

    @Comment("用户ID")
    @FormField(title = "用户", sortNum = "2", type = InputType.select, required = true)
    private Long userId;

    @Comment("订单ID")
    @FormField(title = "订单", sortNum = "3", type = InputType.select)
    private Long orderId;

    @Comment("评分")
    @SearchItem(name = "rating", key = "rating", label = "评分")
    @FormField(title = "评分", sortNum = "4", grid = true, type = InputType.el_input_number)
    private Integer rating;

    @Comment("服务评分")
    @FormField(title = "服务评分", sortNum = "5", type = InputType.el_input_number)
    private Integer serviceRating;

    @Comment("质量评分")
    @FormField(title = "质量评分", sortNum = "6", type = InputType.el_input_number)
    private Integer qualityRating;

    @Comment("配送评分")
    @FormField(title = "配送评分", sortNum = "7", type = InputType.el_input_number)
    private Integer deliveryRating;

    @Comment("评价内容")
    @FormField(title = "评价内容", sortNum = "8", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String content;

    @Comment("评价图片")
    @FormField(title = "评价图片", sortNum = "9", type = InputType.image)
    @Column(columnDefinition = "text")
    private String images;

    @Comment("回复内容")
    @FormField(title = "回复内容", sortNum = "10", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String replyContent;

    @Comment("回复时间")
    @FormField(title = "回复时间", sortNum = "11")
    private Date replyTime;

    @Comment("评价状态")
    @SearchItem(name = "status", key = "status", label = "评价状态")
    @FormField(title = "评价状态", sortNum = "12", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;

    @Comment("是否推荐")
    @FormField(title = "是否推荐", sortNum = "13", grid = true)
    private Boolean recommended;
} 